import 'package:cms/models/single.dart';
import 'package:common/export/http.dart';

class LaraPressSingleApi {
  static const String single = '/v1/single/';

  Future<LarapressPaginatedResponse<SingleModel>> list(
    Map<String, dynamic> params,
  ) async {
    return await LaraPressHttp.instance.dio.getPaginated<SingleModel>(
      single,
      queryParameters: params,
      fromJson: SingleModel.fromJson,
    );
  }

  Future<LarapressResponse<SingleModel>> getSingle(int id) async {
    return await LaraPressHttp.instance.dio.get(
      '$single/$id',
      fromJson: SingleModel.fromJson,
    );
  }
}
